package com.echoesnet.echoesshortvideo.Repositories;

import com.echoesnet.echoesshortvideo.Api.HttpMethods;
import com.echoesnet.echoesshortvideo.Api.RequestHeader;
import com.echoesnet.echoesshortvideo.Constant.Api;

import java.util.Map;

import io.reactivex.Observer;

/**
 * Copyright (C) 2018 科技发展有限公司
 * 完全享有此软件的著作权，违者必究
 * 负责数据处理
 *
 * @author ben
 * @version 1.0
 * @modifier
 * @createDate 2018/4/19 18:12
 * @description
 */

public class FansAndFocusRepository
{
    public void getFollowList(final String tUserId,int start,int num,Observer<String> observer)
    {

        Map<String, Object> reqMap = RequestHeader.getCommonPartOfParam();
        reqMap.put(RequestHeader.OTHER_USER_ID,tUserId);

        reqMap.put(RequestHeader.INDEX,start);
        reqMap.put(RequestHeader.NUM,num);

        HttpMethods.getInstance().startServerRequest(observer, Api.USERC_FOLLOWLIST, reqMap, true);
    }

    public void follow(final String otherId,Observer<String> observer)
    {

        Map<String, Object> reqMap = RequestHeader.getCommonPartOfParam();
        reqMap.put(RequestHeader.OTHER_USER_ID,otherId);


        HttpMethods.getInstance().startServerRequest(observer, Api.USERC_CHECK_FOLLOW, reqMap, true);
    }

    public void getFansList(final String tUserId,int start,int num,Observer<String> observer)
    {

        Map<String, Object> reqMap = RequestHeader.getCommonPartOfParam();
        reqMap.put(RequestHeader.OTHER_USER_ID,tUserId);

        reqMap.put(RequestHeader.INDEX,start);
        reqMap.put(RequestHeader.NUM,num);

        HttpMethods.getInstance().startServerRequest(observer, Api.USERC_FANSLIST, reqMap, true);
    }

    public void pullBlack(final String otherId,Observer<String> observer)
    {

        Map<String, Object> reqMap = RequestHeader.getCommonPartOfParam();
        reqMap.put(RequestHeader.OTHER_USER_ID,otherId);

        HttpMethods.getInstance().startServerRequest(observer, Api.USERC_PULL_BLACK, reqMap, true);
    }

    public void removeBlack(final String otherId,Observer<String> observer)
    {

        Map<String, Object> reqMap = RequestHeader.getCommonPartOfParam();
        reqMap.put(RequestHeader.OTHER_USER_ID,otherId);

        HttpMethods.getInstance().startServerRequest(observer, Api.USERC_REMOVE_BLACK, reqMap, true);
    }
    //获得黑名单列表
    public void getBlackList(int start,int num,Observer<String> observer)
    {

        Map<String, Object> reqMap = RequestHeader.getCommonPartOfParam();
        reqMap.put(RequestHeader.INDEX,start);
        reqMap.put(RequestHeader.NUM,num);

        HttpMethods.getInstance().startServerRequest(observer, Api.USERC_BLACK_LIST, reqMap, true);
    }

       //举报用户
    public void requestReportUser(String otherId,String reason,String content, Observer<String> observer)
    {

        Map<String, Object> reqMap = RequestHeader.getCommonPartOfParam();
        reqMap.put(RequestHeader.OTHER_USER_ID,otherId);
        reqMap.put(RequestHeader.REASON,reason);
        reqMap.put(RequestHeader.DESC,content);

        HttpMethods.getInstance().startServerRequest(observer, Api.USERC_REPORT, reqMap, true);
    }



}
